﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace JuCloudy.Platform.Structure.UserControls
{
    public partial class jChildWindow : UserControl
    {
        public jChildWindow()
        {
            InitializeComponent();
            this.Loaded += (obj, e) =>
            {
                OnLoad();
            };
        }

        private void OnLoad()
        {
            this.btn_Close.MouseEnter += (obj, e) =>
            {
                this.path_close.Fill = new SolidColorBrush(Color.FromArgb(255, 240, 240, 240));
            };

            this.btn_Close.MouseLeave += (obj, e) =>
            {
                this.path_close.Fill = new SolidColorBrush(Colors.White);
            };

            this.btn_Close.Click += (obj, e) =>
            {
                JuCloudy.Framework.Interface.IStructure structure =
                Application.Current.RootVisual as JuCloudy.Framework.Interface.IStructure;
                structure.CloseChildDialog();
            };
        }

        public static UserControl  Show(UIElement ui)
        {
            jChildWindow win = new jChildWindow();
            win.Contentpane.Children.Clear();
            win.Contentpane.Children.Add(ui);
            return win;
        }

        public static UserControl Show(UIElement ui, String Captain)
        {
            jChildWindow win = new jChildWindow();
            win.Contentpane.Children.Clear();
            win.Contentpane.Children.Add(ui);
            win.txt_Title.Text = Captain;
            return win;
        }

       
    }
}
